
###  Plot Different Measures for Appendix ### 



rm(list=ls()) 
 
library(foreign)
library(rgl)


setwd("/Users/davidcarter/Dropbox/Systemic Crisis Rep/")


vol<-read.dta("systemic_yearly_summary2_old.dta")
attach(vol)


### GP Inflation Crises (Figure 6) ##

plot(c(1816,2001),c(0,1),type="n",xlab="Year",ylab="Inflation Measure" , xaxt="n")

lines(year[1:186], perc_inflation[1:186],lwd=3)
axis(1, at = seq(1816, 2000, by = 4), las=2)

claims<-read.dta("yearly_claims_data.dta")
attach(claims)


par(new = T)
with(claims, plot(year[1:186], num_claims[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
axis(side = 4)
mtext(side = 4, 'Number of Claim Onsets')

legend(1818,22,legend=c("% Great Power Inflationary Crises"),lty=1,lwd=3,bty="n",cex=1.25)
legend(1818,20,legend=c("Number of Claim Onsets"), lty=1,lwd=2,bty="n",col="red",cex=1.25)



### % of Great Power Civil War (Figure 7) ##


plot(c(1816,2001),c(0,1),type="n",xlab="Year",ylab="Great Power Intra-State War" , xaxt="n")

lines(year[1:186], perc_intracon[1:186],lwd=3)
axis(1, at = seq(1816, 2000, by = 4), las=2)

claims<-read.dta("systemic_claims_summary_E.dta")
attach(claims)


par(new = T)
with(claims, plot(year[1:186], num_claims[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
axis(side = 4)
mtext(side = 4, 'Number of Claim Onsets')


legend(1818,22,legend=c("% of Great Power Civil Wars"),lty=1,lwd=3,bty="n",cex=1.25)
legend(1818,20,legend=c("Number of Claim Onsets"), lty=1,lwd=2,bty="n",col="red",cex=1.25)




### Percent of Great Powers at War (Figure 8) ##


plot(c(1816,2001),c(0,1),type="n",xlab="Year",ylab="Great Power War" , xaxt="n")

lines(year[1:186], perc_GPwar[1:186],lwd=3)
axis(1, at = seq(1816, 2000, by = 4), las=2)

claims<-read.dta("systemic_claims_summary_E.dta")
attach(claims)


par(new = T)
with(claims, plot(year[1:186], num_claims[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
axis(side = 4)
mtext(side = 4, 'Number of Claim Onsets')


#par(new = T)
#with(claims, plot(year[1:186], claim_rate[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
#axis(side = 4)
#mtext(side = 4, 'Number of Claim Onsets')

legend(1818,22,legend=c("% of Great Powers at War"),lty=1,lwd=3,bty="n",cex=1.25)
legend(1818,20,legend=c("Number of Claim Onsets"), lty=1,lwd=2,bty="n",col="red",cex=1.25)


### Number of New Dyads (Figure 9) ##


plot(c(1816,2001),range(num_newdyads),type="n",xlab="Year",ylab="Number of New States in System" , xaxt="n")

lines(year[1:186], num_newdyads[1:186],lwd=3)
axis(1, at = seq(1816, 2000, by = 4), las=2)


claims<-read.dta("systemic_claims_summary_E.dta")
attach(claims)


par(new = T)
with(claims, plot(year[1:186], num_claims[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
axis(side = 4)
mtext(side = 4, 'Number of Claim Onsets')

legend(1818,22,legend=c("Number of New States"),lty=1,lwd=3,bty="n",cex=1.25)
legend(1818,20,legend=c("Number of Claim Onsets"), lty=1,lwd=2,bty="n",col="red",cex=1.25)




### Number of Secessions (Figure 10) ##


plot(c(1816,2001),range(num_claims),type="n",xlab="Year",ylab="Number of Secessions in System" , xaxt="n")

lines(year[1:186], num_secessions[1:186],lwd=3)
axis(1, at = seq(1816, 2000, by = 4), las=2)


claims<-read.dta("systemic_claims_summary_E.dta")
attach(claims)


par(new = T)
with(claims, plot(year[1:186], num_claims[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
axis(side = 4)
mtext(side = 4, 'Number of Claim Onsets')

legend(1818,22,legend=c("Number of Secessions"),lty=1,lwd=3,bty="n",cex=1.25)
legend(1818,20,legend=c("Number of Claim Onsets"), lty=1,lwd=2,bty="n",col="red",cex=1.25)


### Great Power Proxy Wars (Figure 11) ##


plot(c(1816,2001),range(num_claims),type="n",xlab="Year",ylab="Number of Great Power Proxy Wars" , xaxt="n")

lines(year[1:186], proxywars_m[1:186],lwd=3)
axis(1, at = seq(1816, 2000, by = 4), las=2)


claims<-read.dta("systemic_claims_summary_E.dta")
attach(claims)


par(new = T)
with(claims, plot(year[1:186], num_claims[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
axis(side = 4)
mtext(side = 4, 'Number of Claim Onsets')


legend(1806,22,legend=c("Great Power Proxy Conflicts"),lty=1,lwd=3,bty="n",cex=1.25)
legend(1806,20,legend=c("Number of Claim Onsets"), lty=1,lwd=2,bty="n",col="red",cex=1.25)





### Great Power Alliance Shifts (Figure 12) ##


plot(c(1816,2001),range(GPallych_sys_M),type="n",xlab="Year",ylab="Systemic Great Power Alliance Changes" , xaxt="n")

lines(year[1:186], GPallych_sys_M[1:186],lwd=3)
axis(1, at = seq(1816, 2000, by = 4), las=2)


claims<-read.dta("systemic_claims_summary_E.dta")
attach(claims)


par(new = T)
with(claims, plot(year[1:186], num_claims[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
axis(side = 4)
mtext(side = 4, 'Number of Claim Onsets')


legend(1806,22,legend=c("Systemic Great Power Alliance Changes"),lty=1,lwd=3,bty="n",cex=1.25)
legend(1806,20,legend=c("Number of Claim Onsets"), lty=1,lwd=2,bty="n",col="red",cex=1.25)







